package com.ashley.day_09;

/**
 * @Author ashley
 * @Date 2019/8/1 14:35
 */
public class ValueTransferTest2 {
    public static void main(String[] args) {
       Date date = new Date();

       date.m = 20;
       date.n = 10;

        System.out.println("m = "+ date.m + ", n = " + date.n);

//        int temp = date.m;
//        date.m = date.n;
//        date.n = temp;

        ValueTransferTest2 test = new ValueTransferTest2();
        test.swap(date);

        System.out.println("m = "+ date.m + ", n = " + date.n);
    }
    public void swap(Date date){
        int temp = date.m;
        date.m = date.n;
        date.n = temp;
    }
}
class Date{
    int m;
    int n;

    }